class Person {
  // 与js不同的是，这里的name，age必须显示的声明处理，不让会直接报错
  name: string = "";
  age: number = 0;
  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
  }
}

const p1: Person = new Person("zs", 12);
console.log(p1.name, p1.age);

export {};
